// 命令基类
class BaseCommand {
    viewer: any
    eventsManager: any
    widgetsManager: any

    constructor() { }

    // 不可复写
    private register(params:any){
        this.viewer = params.viewer
        this.eventsManager = params.eventsManager
        this.widgetsManager = params.widgetsManager
    }

    // 执行命令,必须复写
    execute(option: any) {
        throw new Error('子类必须重写父类的execute方法')
    }

    // 释放资源
    release() { }

    // 判断可用不可用状态，return true则为可用，return false 则为不可用
    isEnable(option: any) {
        return true
    }
}

export default BaseCommand